# Maintainer: Anatol Pomozov <anatol.pomozov at gmail>

pkgname=libelfin
pkgver=0.3
pkgrel=2
pkgdesc='C++11 ELF/DWARF parser'
arch=(loong64 x86_64)
url='https://github.com/aclements/libelfin'
license=(MIT)
depends=(gcc-libs)
makedepends=(python)
source=(libelfin-$pkgver.zip::https://github.com/aclements/libelfin/archive/v$pkgver.zip
	make_prefix.patch::https://github.com/aclements/libelfin/commit/6e26e3bb6feeb851d87c74c9cd39a2374b9bab0a.patch
        reproducible.patch)
sha256sums=('e85c9edd583a59a08b97c34e5f385162fb32135cd09977aaefbc1bbcac9d51e7'
            '9f6ed990971de640c9e1dd2c1b79b973915d53e5b330a367aee3f93d2cf18ed4'
            '152a7eab55b4de3cefa0020066ff82bdbc307a695bfe8362d4d8055cbbf654d8')

prepare() {
  cd libelfin-$pkgver
  patch -p1 < ../reproducible.patch

  patch -p1 < ../make_prefix.patch # https://github.com/aclements/libelfin/pull/42
}

build() {
  cd libelfin-$pkgver
  VER=$pkgver make
}

package() {
  cd libelfin-$pkgver
  VER=$pkgver PREFIX=/usr DESTDIR="$pkgdir" make install
}
